#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int maximum69Number(int num) {
        string s1(to_string(num));
        for (auto& e : s1)
        {
            if (e == '6')
            {
                e = '9';
                break;
            }
        }
        int max = stoi(s1);
        return max;
    }
};